﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:converter="clr-namespace:KnowledgeKiosk.Converters" mc:Ignorable="d" x:Name="digitalClock" x:Class="KnowledgeKiosk.DigitalClockControl"
	Foreground="White" Background="#3FFFFFFF" FontSize="21.333">
	<UserControl.Resources>
		<converter:TimeToIndicesConverter x:Key="timeToIndicesConverter"/>
	</UserControl.Resources>
	<StackPanel x:Name="LayoutRoot">
		<Grid>
			<Viewbox>
				<Glyphs x:Name="glyphsBack" Fill="{Binding Background, ElementName=digitalClock}" 
					UnicodeString="88:88" FontUri="/Fonts/DS-DIGIB.TTF" FontRenderingEmSize="100"/>
			</Viewbox>
			<Viewbox>
				<Glyphs x:Name="glyphsFront" Fill="{Binding Foreground, ElementName=digitalClock}" 
					UnicodeString="{Binding DateAndTime, ElementName=digitalClock, FallbackValue=00:00, StringFormat=\{0:HH:mm\}}"
					FontUri="/Fonts/DS-DIGIB.TTF" FontRenderingEmSize="100"
					Indices="{Binding DateAndTime, Converter={StaticResource timeToIndicesConverter}, ElementName=digitalClock}"/>
			</Viewbox>
		</Grid>
		<TextBlock x:Name="Date"
			Text="{Binding DateAndTime, ConverterCulture=nl-NL, ElementName=digitalClock, FallbackValue=11/12/2011, StringFormat=\{0:d\}}" 
			TextAlignment="Center"/>
	</StackPanel>
	</UserControl>